/* eslint-disable */
var fs =require('fs')
var addressFile=fs.readFileSync('企业地址.json','utf-8')
var locationFile=fs.readFileSync('企业经纬度.json','utf-8')

var infoArr=JSON.parse(fs.readFileSync('企业信息.json','utf-8'))
var addressArr=JSON.parse(addressFile)
var locationArr=JSON.parse(locationFile)

var newArr=[]
var notArr=[]
var outArr=[]
let count=0

for (let i=0;i<addressArr.length;i++){
    for(let j=0;j<locationArr.length;j++){
        if(addressArr[i].address===locationArr[j].关键词){
            let obj=Object.assign({name:addressArr[i].name},locationArr[j])
            newArr.push(obj)
            break
        }
    }
}


for (let i=0;i<addressArr.length;i++){
    for(let j=0;j<newArr.length;j++){
        if(infoArr[i].法人单位名称_盖章_===newArr[j].name){
            let obj=Object.assign(infoArr[i],newArr[j])
            outArr.push(obj)
            break
        }
    }
}
console.log('新企业地址：'+newArr.length)
console.log('新企业信息：'+outArr.length)
fs.writeFileSync('./新企业地址.json',JSON.stringify(newArr,null,'\t'))
fs.writeFileSync('./新企业信息.json',JSON.stringify(outArr,null,'\t'))